﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="LanguageConverterTemplate.PickOnePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:LanguageConverterTemplate"
    xmlns:common="using:LanguageConverterTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="Assets/Bg.jpg"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Translate" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>
        
        <ScrollViewer x:Name="ScrMain" Margin="0" Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" ZoomMode="Disabled">
            <StackPanel Width="1176" HorizontalAlignment="Left" Margin="120,0,0,0" VerticalAlignment="Top">
                <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="26.667" Text="Day to Day Use"/>
                <StackPanel HorizontalAlignment="Left" Height="532" Margin="0,15,0,0" Width="1176" VerticalAlignment="Top" Orientation="Horizontal">
                    <Grid Height="532" Margin="0" VerticalAlignment="Top" Width="344" HorizontalAlignment="Left" Background="#D8161E09"/>
                    <Grid Height="532" Margin="15,0,0,0" VerticalAlignment="Top" Width="816" Background="#D8C3D1A1" HorizontalAlignment="Left">
                        <Grid HorizontalAlignment="Left" Height="496" Margin="40,40,0,0" VerticalAlignment="Top" Width="550">
                            <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Text="TRANSLATE" VerticalAlignment="Top" Foreground="#FF2B260A" FontFamily="Segoe UI" FontSize="32"/>
                            <StackPanel Margin="0,85,0,0" Orientation="Vertical" Width="220" Height="350" HorizontalAlignment="Left" VerticalAlignment="Top">
                                <GridViewItem x:Name="GoodDay" Content="Text 1" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="White" FontSize="20" Height="50" Width="200" Tapped="GoodDay_Tapped" Background="#002B260B" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodMorning" Content="Text 2" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Width="200" Tapped="GoodMorning_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodAfternoon" Content="Text 3" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Width="200" Tapped="GoodAfternoon_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodEvening" Content="Text 4" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Tapped="GoodEvening_Tapped" Width="200" Style="{StaticResource TextGridViewItemStyle}"/>
                            </StackPanel>
                            <StackPanel Margin="0,85,0,0" Orientation="Vertical" Width="250" Height="350" HorizontalAlignment="Right" VerticalAlignment="Top">
                                <GridViewItem x:Name="HowRU" Content="Text 5" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Tapped="HowRU_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="WhereRU" Content="Text 6" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Tapped="WhereRU_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="CanUHelp" Content="Text 7" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Tapped="CanUHelp_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="CanUHelp1" Content="Text 8" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="20" Height="50" Tapped="CanUHelp_Tapped" Style="{StaticResource TextGridViewItemStyle}"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>
        
        <Grid x:Name="SnapView" Grid.Row="1" Visibility="Collapsed">
        	<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Please switch fullscreen to view content" VerticalAlignment="Center" 
                       FontFamily="Segoe UI" FontSize="26" TextAlignment="Center"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup>
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SnapView">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Visible</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ScrMain">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
